﻿//
// Created by 17616 on 2021/5/22.
//

#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <thread>
#include "public.h"

std::string in_pic = R"(C:\Users\17616\Desktop\本科毕设\实验数据记录\2021-5-20\G0_0-F4-0520\G0_0-LD3I2\合成.tiff)";

int main(int argn, const char **argv) {
    if (argn == 1) {
        return 0;
    } else if (strcmp(argv[1], "--test") == 0) {
    } else {
        std::cout << "file= " << argv[1] << std::endl;
        in_pic = argv[1];
    }
    cv::Mat in = cv::imread(in_pic, cv::IMREAD_UNCHANGED);
    cv::Mat out = cv::Mat(in.size(), CV_32F);

    int Sigma1;
    std::cout << "输入Sigma1" << std::endl;
    std::cin >> Sigma1;
    Sigma1 |= 1;
    std::cout << "Sigma1=" << Sigma1 << std::endl;

    cv::GaussianBlur(in, out, cv::Size(0, 0), Sigma1);
    cv::imwrite(GetFilePath(in_pic) + "Blur.tiff", out);
    return 0;
}